import { login } from '@/api';
import { QueryFilter, useAntdList } from '@web-design/ui';
import { Button, Card, Form, Space, Table } from 'antd';
import { ColumnProps, ColumnType, ColumnsType } from 'antd/lib/table';
import React from 'react';
const App = () => {
    const [form] = Form.useForm();
    const { tableProps, search } = useAntdList(login, { form })
    const columns: ColumnsType<any> = [
        {
            title: '用户ID'
        }, {
            title: '用户名称'
        },{
            title: '手机号码'
        },{
            title: '状态'
        },{
            title: '关联角色'
        },{
            title: '创建时间'
        },{
            title: '操作',
            render(){
                return <Space>
                    <Button>编辑</Button>
                    <Button>禁用</Button>
                    <Button>重置密码</Button>
                </Space>
            }
        }
    ]
    return (<Card>
        <QueryFilter
            items={[{
                label: '用户名称',
                name: 'name'
            }, {
                name: 'nn',
                label: '手机号码'
            }]}
            form={form} reset={search.reset} submit={search.submit} />
        <Table columns={columns} {...tableProps} />
    </Card>)
}
export default App